const darkTheme = '#282828'
const lightTheme = '#f4f5f6'
const darkContentTheme = '#333'
const lighContentTheme = '#fff'
const darkText = '#ddd'
const lightText = '#000'

// 获取对应的主题色值
export const getThemeMap = (isLight) => { 
  return {
    'theme-bg': isLight ? lightTheme : darkTheme,
    'theme-content-color': isLight ? lighContentTheme : darkContentTheme,
    'themt-text-color': isLight ? lightText : darkText,
    'n-item-text-color': isLight ? lightText : darkText
  }
}

// 设置主题色值
export const setTheme = (isLight = true) => {
  const themeMap = getThemeMap(isLight)
  const body = document.body
  /* 实现方式一 */
  Object.keys(themeMap).forEach(key => {
    body.style.setProperty(`--${key}`, themeMap[key])
  })
  
  /* 实现方式二 */
  // body.style.setProperty('data-theme', isLight ? 'light' : 'dark')
}